const IfRender: React.FC<{
  condition: boolean | undefined;
  children?: React.ReactNode;
  ifRender?: () => React.ReactNode;
  elseRender?: () => React.ReactNode;
}> = (props) => {
  if (props.condition) {
    if (props.ifRender) {
      return <>{props.ifRender()}</>;
    }
    return <>{props.children}</>;
  }
  if (props.elseRender) {
    return <>{props.elseRender()}</>;
  }
  return <></>;
};
export default IfRender;
